

<!DOCTYPE html>
<html lang="zh-CN" data-default-color-scheme=auto>



<head>
  <meta charset="UTF-8">
  <link rel="apple-touch-icon" sizes="76x76" href="/img/Mine.jpg">
  <link rel="icon" href="/img/Mine.jpg">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=5.0, shrink-to-fit=no">
  <meta http-equiv="x-ua-compatible" content="ie=edge">
  
  <meta name="theme-color" content="#2f4154">
  <meta name="author" content="Chiam">
  <meta name="keywords" content="算法，安全">
  
    <meta name="description" content="『算法-ACM 竞赛-真题』2019ICPC 银川网络赛 D.TakeYourSeat（疯子坐飞机问题）2019 ICPC 银川网络赛 D. Take Your Seat （疯子坐飞机问题）Duha decided to have a trip to Singapore by plane. The airplane had nn seats numbered from 11 to nn, and">
<meta property="og:type" content="article">
<meta property="og:title" content="『算法-ACM竞赛-真题』2019ICPC银川网络赛D.TakeYourSeat（疯子坐飞机问题）">
<meta property="og:url" content="http://example.com/2023/12/06/%E3%80%8E%E7%AE%97%E6%B3%95-ACM%E7%AB%9E%E8%B5%9B-%E7%9C%9F%E9%A2%98%E3%80%8F2019ICPC%E9%93%B6%E5%B7%9D%E7%BD%91%E7%BB%9C%E8%B5%9BD.TakeYourSeat%EF%BC%88%E7%96%AF%E5%AD%90%E5%9D%90%E9%A3%9E%E6%9C%BA%E9%97%AE%E9%A2%98%EF%BC%89/index.html">
<meta property="og:site_name" content="Chiam 的个人主页">
<meta property="og:description" content="『算法-ACM 竞赛-真题』2019ICPC 银川网络赛 D.TakeYourSeat（疯子坐飞机问题）2019 ICPC 银川网络赛 D. Take Your Seat （疯子坐飞机问题）Duha decided to have a trip to Singapore by plane. The airplane had nn seats numbered from 11 to nn, and">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://private.codecogs.com/gif.latex?%5Cfrac%7B1%7D%7B2%7D*%5Cfrac%7BN-1%7D%7BN%7D+1*%5Cfrac%7B1%7D%7BN%7D=%5Cfrac%7BN+1%7D%7B2N%7D">
<meta property="article:published_time" content="2023-12-05T16:11:45.013Z">
<meta property="article:modified_time" content="2023-12-05T16:19:54.190Z">
<meta property="article:author" content="Chiam">
<meta property="article:tag" content="算法，安全">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:image" content="https://private.codecogs.com/gif.latex?%5Cfrac%7B1%7D%7B2%7D*%5Cfrac%7BN-1%7D%7BN%7D+1*%5Cfrac%7B1%7D%7BN%7D=%5Cfrac%7BN+1%7D%7B2N%7D">
  
  
  
  <title>『算法-ACM竞赛-真题』2019ICPC银川网络赛D.TakeYourSeat（疯子坐飞机问题） - Chiam 的个人主页</title>

  <link  rel="stylesheet" href="https://lib.baomitu.com/twitter-bootstrap/4.6.1/css/bootstrap.min.css" />



  <link  rel="stylesheet" href="https://lib.baomitu.com/github-markdown-css/4.0.0/github-markdown.min.css" />

  <link  rel="stylesheet" href="https://lib.baomitu.com/hint.css/2.7.0/hint.min.css" />

  <link  rel="stylesheet" href="https://lib.baomitu.com/fancybox/3.5.7/jquery.fancybox.min.css" />



<!-- 主题依赖的图标库，不要自行修改 -->
<!-- Do not modify the link that theme dependent icons -->

<link rel="stylesheet" href="//at.alicdn.com/t/font_1749284_hj8rtnfg7um.css">



<link rel="stylesheet" href="//at.alicdn.com/t/font_1736178_lbnruvf0jn.css">


<link  rel="stylesheet" href="/css/main.css" />


  <link id="highlight-css" rel="stylesheet" href="/css/highlight.css" />
  
    <link id="highlight-css-dark" rel="stylesheet" href="/css/highlight-dark.css" />
  



  
<link rel="stylesheet" href="/css/custom.css">



  <script id="fluid-configs">
    var Fluid = window.Fluid || {};
    Fluid.ctx = Object.assign({}, Fluid.ctx)
    var CONFIG = {"hostname":"example.com","root":"/","version":"1.9.5-a","typing":{"enable":true,"typeSpeed":70,"cursorChar":"_","loop":false,"scope":[]},"anchorjs":{"enable":true,"element":"h1,h2,h3,h4,h5,h6","placement":"left","visible":"hover","icon":"❡"},"progressbar":{"enable":true,"height_px":3,"color":"#29d","options":{"showSpinner":false,"trickleSpeed":100}},"code_language":{"enable":true,"default":"TEXT"},"copy_btn":true,"image_caption":{"enable":true},"image_zoom":{"enable":true,"img_url_replace":["",""]},"toc":{"enable":true,"placement":"right","headingSelector":"h1,h2,h3,h4,h5,h6","collapseDepth":2},"lazyload":{"enable":true,"loading_img":"/img/loading.gif","onlypost":false,"offset_factor":2},"web_analytics":{"enable":false,"follow_dnt":true,"baidu":null,"google":{"measurement_id":null},"tencent":{"sid":null,"cid":null},"woyaola":null,"cnzz":null,"leancloud":{"app_id":null,"app_key":null,"server_url":null,"path":"window.location.pathname","ignore_local":false}},"search_path":"/local-search.xml","include_content_in_search":true};

    if (CONFIG.web_analytics.follow_dnt) {
      var dntVal = navigator.doNotTrack || window.doNotTrack || navigator.msDoNotTrack;
      Fluid.ctx.dnt = dntVal && (dntVal.startsWith('1') || dntVal.startsWith('yes') || dntVal.startsWith('on'));
    }
  </script>
  <script  src="/js/utils.js" ></script>
  <script  src="/js/color-schema.js" ></script>
  


  
<meta name="generator" content="Hexo 6.3.0"></head>


<body>
  

  <header>
    

<div class="header-inner" style="height: 70vh;">
  <nav id="navbar" class="navbar fixed-top  navbar-expand-lg navbar-dark scrolling-navbar">
  <div class="container">
    <a class="navbar-brand" href="/">
      <strong>Chiam&#39;s Blogs</strong>
    </a>

    <button id="navbar-toggler-btn" class="navbar-toggler" type="button" data-toggle="collapse"
            data-target="#navbarSupportedContent"
            aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
      <div class="animated-icon"><span></span><span></span><span></span></div>
    </button>

    <!-- Collapsible content -->
    <div class="collapse navbar-collapse" id="navbarSupportedContent">
      <ul class="navbar-nav ml-auto text-center">
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/">
                
                <span>首页</span>
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/archives/">
                
                <span>归档</span>
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/categories/">
                
                <span>分类</span>
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/about/">
                
                <span>关于</span>
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/links/">
                
                <span>友链</span>
              </a>
            </li>
          
        
        
          <li class="nav-item" id="search-btn">
            <a class="nav-link" target="_self" href="javascript:;" data-toggle="modal" data-target="#modalSearch" aria-label="Search">
              <i class="iconfont icon-search"></i>
            </a>
          </li>
          
        
        
          <li class="nav-item" id="color-toggle-btn">
            <a class="nav-link" target="_self" href="javascript:;" aria-label="Color Toggle">
              <i class="iconfont icon-dark" id="color-toggle-icon"></i>
            </a>
          </li>
        
      </ul>
    </div>
  </div>
</nav>

  

<div id="banner" class="banner" parallax=true
     style="background: url('/img/default.png') no-repeat center center; background-size: cover;">
  <div class="full-bg-img">
    <div class="mask flex-center" style="background-color: rgba(0, 0, 0, 0.3)">
      <div class="banner-text text-center fade-in-up">
        <div class="h2">
          
            <span id="subtitle" data-typed-text="『算法-ACM竞赛-真题』2019ICPC银川网络赛D.TakeYourSeat（疯子坐飞机问题）"></span>
          
        </div>

        
          
  <div class="mt-3">
    
    
      <span class="post-meta">
        <i class="iconfont icon-date-fill" aria-hidden="true"></i>
        <time datetime="2023-12-06 00:11" pubdate>
          2023年12月6日 凌晨
        </time>
      </span>
    
  </div>

  <div class="mt-1">
    
      <span class="post-meta mr-2">
        <i class="iconfont icon-chart"></i>
        
          3.5k 字
        
      </span>
    

    
      <span class="post-meta mr-2">
        <i class="iconfont icon-clock-fill"></i>
        
        
        
          29 分钟
        
      </span>
    

    
    
  </div>


        
      </div>

      
    </div>
  </div>
</div>

</div>

  </header>

  <main>
    
      

<div class="container-fluid nopadding-x">
  <div class="row nomargin-x">
    <div class="side-col d-none d-lg-block col-lg-2">
      

    </div>

    <div class="col-lg-8 nopadding-x-md">
      <div class="container nopadding-x-md" id="board-ctn">
        <div id="board">
          <article class="post-content mx-auto">
            <h1 id="seo-header">『算法-ACM竞赛-真题』2019ICPC银川网络赛D.TakeYourSeat（疯子坐飞机问题）</h1>
            
            
              <div class="markdown-body">
                
                <h1 id="『算法-ACM-竞赛-真题』2019ICPC-银川网络赛-D-TakeYourSeat（疯子坐飞机问题）"><a href="#『算法-ACM-竞赛-真题』2019ICPC-银川网络赛-D-TakeYourSeat（疯子坐飞机问题）" class="headerlink" title="『算法-ACM 竞赛-真题』2019ICPC 银川网络赛 D.TakeYourSeat（疯子坐飞机问题）"></a>『算法-ACM 竞赛-真题』2019ICPC 银川网络赛 D.TakeYourSeat（疯子坐飞机问题）</h1><h1 id="2019-ICPC-银川网络赛-D-Take-Your-Seat-（疯子坐飞机问题）"><a href="#2019-ICPC-银川网络赛-D-Take-Your-Seat-（疯子坐飞机问题）" class="headerlink" title="2019 ICPC 银川网络赛 D. Take Your Seat （疯子坐飞机问题）"></a>2019 ICPC 银川网络赛 D. Take Your Seat （疯子坐飞机问题）</h1><p>Duha decided to have a trip to Singapore by plane.</p>
<p>The airplane had nn seats numbered from 11 to nn, and nn passengers including Duha which were also counted from 11 to nn. The passenger with number ii held the ticket corresponding to the seat with number ii, and Duha was the number 11 passenger.</p>
<p>All passengers got on the plane in the order of their numbers from 11 to nn. However, before they got on the plane Duha lost his ticket (and Duha was the only passenger who lost the ticket), so he could not take his seat correctly. He decided to take a seat randomly. And after that, while a passenger got on the plane and found that his&#x2F;her seat has been occupied, he&#x2F;she selected an empty seat randomly as well. A passenger except Duha selected the seat displayed in his&#x2F;her ticket if it had not been occupied by someone else.</p>
<p>The first problem you are asked to calculate in this problem is the probability of the last passenger to get on the plane that took his&#x2F;her correct seat.</p>
<p>Several days later, Duha finished his travel in Singapore, and he had a great time.</p>
<p>On the way back, he lost his ticket again. And at this time, the airplane had mm seats numbered from 11 to mm, and mm passengers including Duha which were also counted from 11 to mm. The passenger with number ii held the ticket corresponding to the seat with number ii, and Duha was the number 11 passenger as well.</p>
<p>The difference was that: all passengers got on the plane in a random order (which was any one of the mm! different orders with the same chance). Similarly, Duha or a passenger who found his&#x2F;her seat had been occupied selected an empty seat randomly.</p>
<p>The second problem you are asked to calculate in this problem is the probability of the last passenger to get on the plane that took his&#x2F;her right seat on the return trip.</p>
<h4 id="Input"><a href="#Input" class="headerlink" title="Input"></a>Input</h4><p>The input contains several test cases, and the first line is a positive integer TT indicating the number of test cases which is up to 5050.</p>
<p>For each test case, a line contains two integers nn and m (1 \le n, m \le 50)m(1≤n,m≤50).</p>
<h4 id="Output"><a href="#Output" class="headerlink" title="Output"></a>Output</h4><p>For each test case, output a line containing <strong>Case #x: y z</strong>, where xx is the test case number starting from 11, yy is the answer of the first problem, and zz is the answer of the second problem. Both of yy and zz are rounded to 66 places, and we guarantee that their 77-th places after the decimal point in the precise answer would not be 44 or 55.</p>
<p>输出时每行末尾的多余空格，不影响答案正确性</p>
<p>样例输入复制</p>
<pre><code class="hljs">1
2 3
</code></pre>
<p>样例输出复制</p>
<pre><code class="hljs">Case #1: 0.500000 0.666667
</code></pre>
<p>这个题，一场比赛下来，有人跑过来跟我说容斥定理，又有什么 DFS 的，这些全是抄题解，这不就是一个推公式的题目吗？队友推了很久，最后在一群人的指点江山下，自己推出公式；这个题就是一个疯子坐飞机概率问题：<a target="_blank" rel="noopener" href="https://www.zhihu.com/question/35950050/answer/65272204">https://www.zhihu.com/question/35950050/answer/65272204</a></p>
<p>先讨论第一问，第一问的话，当这个呆瓜坐下，无论前 N-1 个怎么做，最后一个上来的人面对的是一个独立问题，是坐对或坐错，我们论证一下：</p>
<p>1、当只有两个人的时候，呆瓜是第一个，他有两种选择，作对坐不对，那么对于最后一个人，也有两种情况，坐对，坐错。</p>
<p>2、当只有三个人的时候，呆瓜是第一个，那么他有三种选择，1，2，3 那么他有 1&#x2F;3 的几率坐对，而只有他蠢，他坐对了，其他人都坐对了，在考虑其余 2&#x2F;3，那么对于当第一个人做了第二个人的位置，那么第二个人上来之后可以做第一个人的位置，也可以坐第三个人的位置，那么第三个人坐对的概率是 1&#x2F;2,在讨论，当第一个人做了第三个人的位置时，第三个人一定做不到自己的位置上，那么坐对坐不对的情况都是 1&#x2F;3+1&#x2F;6&#x3D;1&#x2F;2。</p>
<p>3、那么当有四个人的时候，他坐在对于他做的四种情况都能推导到比他更低的人数的情况，而对于每种情况都是 1&#x2F;2，</p>
<p>那么第一问的答案永远都是 1&#x2F;2，那么我们考虑第二问，除了这个呆瓜之外，在他之前上来的肯定都坐对了，那么转化为第一种情况，除了一个人的时候是 1 之外，除了 1&#x2F;2 之外还有第三种情况，是呆瓜最后上来，别人都坐对了，那他肯定也做对了，就是 1，所以这个题的话就是有 1&#x2F;N 的几率呆瓜最后上来，有 N-1&#x2F;N 的情况是他在之前上来 1&#x2F;2 的情况，那么答案即为 <img src="https://private.codecogs.com/gif.latex?%5Cfrac%7B1%7D%7B2%7D*%5Cfrac%7BN-1%7D%7BN%7D+1*%5Cfrac%7B1%7D%7BN%7D=%5Cfrac%7BN+1%7D%7B2N%7D" srcset="/img/loading.gif" lazyload alt="\frac{1}{2}*\frac{N-1}{N}+1*\frac{1}{N}=\frac{N+1}{2N}"></p>
<pre><code class="hljs">#include&lt;stdio.h&gt;
#include&lt;algorithm&gt;
#include&lt;iostream&gt;
#include&lt;string.h&gt;
#include&lt;math.h&gt;
#include&lt;vector&gt;
#include&lt;map&gt;
#include&lt;iomanip&gt;
using namespace std;
#define LL long long
#define MAXN 1000100
int main()
&#123;
    int t,n,m,p=1;
    cin&gt;&gt;t;
    while(t--)
    &#123;
        cin&gt;&gt;n&gt;&gt;m;
        cout&lt;&lt;&quot;Case #&quot;&lt;&lt;p++&lt;&lt;&quot;: &quot;;
        if(n==1)
            cout&lt;&lt;&quot;1.000000&quot;&lt;&lt;&#39; &#39;;
        else
            cout&lt;&lt;&quot;0.500000&quot;&lt;&lt;&#39; &#39;;
        cout&lt;&lt;fixed&lt;&lt;setprecision(6)&lt;&lt;(m+1)*1.0/(2*m)&lt;&lt;endl;
    &#125;
</code></pre>

                
              </div>
            
            <hr/>
            <div>
              <div class="post-metas my-3">
  
    <div class="post-meta mr-3 d-flex align-items-center">
      <i class="iconfont icon-category"></i>
      

<span class="category-chains">
  
  
    
      <span class="category-chain">
        
  <a href="/categories/%E7%AE%97%E6%B3%95/" class="category-chain-item">算法</a>
  
  
    <span>></span>
    
  <a href="/categories/%E7%AE%97%E6%B3%95/ACM%E7%AB%9E%E8%B5%9B/" class="category-chain-item">ACM竞赛</a>
  
  
    <span>></span>
    
  <a href="/categories/%E7%AE%97%E6%B3%95/ACM%E7%AB%9E%E8%B5%9B/%E7%9C%9F%E9%A2%98/" class="category-chain-item">真题</a>
  
  

  

  

      </span>
    
  
</span>

    </div>
  
  
</div>


              
  

  <div class="license-box my-3">
    <div class="license-title">
      <div>『算法-ACM竞赛-真题』2019ICPC银川网络赛D.TakeYourSeat（疯子坐飞机问题）</div>
      <div>http://example.com/2023/12/06/『算法-ACM竞赛-真题』2019ICPC银川网络赛D.TakeYourSeat（疯子坐飞机问题）/</div>
    </div>
    <div class="license-meta">
      
        <div class="license-meta-item">
          <div>作者</div>
          <div>Chiam</div>
        </div>
      
      
        <div class="license-meta-item license-meta-date">
          <div>发布于</div>
          <div>2023年12月6日</div>
        </div>
      
      
      
        <div class="license-meta-item">
          <div>许可协议</div>
          <div>
            
              
              
                <a class="print-no-link" target="_blank" href="https://creativecommons.org/licenses/by/4.0/">
                  <span class="hint--top hint--rounded" aria-label="BY - 署名">
                    <i class="iconfont icon-by"></i>
                  </span>
                </a>
              
            
          </div>
        </div>
      
    </div>
    <div class="license-icon iconfont"></div>
  </div>



              
                <div class="post-prevnext my-3">
                  <article class="post-prev col-6">
                    
                    
                      <a href="/2023/12/06/%E3%80%8E%E7%AE%97%E6%B3%95-ACM%E7%AB%9E%E8%B5%9B-%E7%9C%9F%E9%A2%98%E3%80%8F2019ICPC%E9%93%B6%E5%B7%9D%E7%BD%91%E7%BB%9C%E8%B5%9BF-MovingOn%EF%BC%88%E5%8D%A1Cache%EF%BC%89/" title="『算法-ACM竞赛-真题』2019ICPC银川网络赛F-MovingOn（卡Cache）">
                        <i class="iconfont icon-arrowleft"></i>
                        <span class="hidden-mobile">『算法-ACM竞赛-真题』2019ICPC银川网络赛F-MovingOn（卡Cache）</span>
                        <span class="visible-mobile">上一篇</span>
                      </a>
                    
                  </article>
                  <article class="post-next col-6">
                    
                    
                      <a href="/2023/12/06/%E3%80%8E%E7%AE%97%E6%B3%95-ACM%E7%AB%9E%E8%B5%9B-%E7%9C%9F%E9%A2%98%E3%80%8F2019ICPC%E5%8D%97%E4%BA%AC%E7%BD%91%E7%BB%9C%E8%B5%9BH-HolyGrail/" title="『算法-ACM竞赛-真题』2019ICPC南京网络赛H-HolyGrail">
                        <span class="hidden-mobile">『算法-ACM竞赛-真题』2019ICPC南京网络赛H-HolyGrail</span>
                        <span class="visible-mobile">下一篇</span>
                        <i class="iconfont icon-arrowright"></i>
                      </a>
                    
                  </article>
                </div>
              
            </div>

            
  
  
    <article id="comments" lazyload>
      
  <div id="valine"></div>
  <script type="text/javascript">
    Fluid.utils.loadComments('#valine', function() {
      Fluid.utils.createScript('https://lib.baomitu.com/valine/1.5.1/Valine.min.js', function() {
        var options = Object.assign(
          {"appId":"fIfc7WqUDZohlQuPc2lz5mJy-MdYXbMMI","appKey":"zjlAG3ZA3o4cBHVAkjzc2Z20","path":"window.location.pathname","placeholder":"留言仅限讨论，禁止广告等行为","avatar":"retro","meta":["nick","mail","link"],"requiredFields":[],"pageSize":10,"lang":"zh-CN","highlight":false,"recordIP":false,"serverURLs":"https://fifc7wqu.api.lncldglobal.com","emojiCDN":null,"emojiMaps":null,"enableQQ":false},
          {
            el: "#valine",
            path: window.location.pathname
          }
        )
        new Valine(options);
        Fluid.utils.waitElementVisible('#valine .vcontent', () => {
          var imgSelector = '#valine .vcontent img:not(.vemoji)';
          Fluid.plugins.imageCaption(imgSelector);
          Fluid.plugins.fancyBox(imgSelector);
        })
      });
    });
  </script>
  <noscript>Please enable JavaScript to view the comments</noscript>


    </article>
  


          </article>
        </div>
      </div>
    </div>

    <div class="side-col d-none d-lg-block col-lg-2">
      
  <aside class="sidebar" style="margin-left: -1rem">
    <div id="toc">
  <p class="toc-header">
    <i class="iconfont icon-list"></i>
    <span>目录</span>
  </p>
  <div class="toc-body" id="toc-body"></div>
</div>



  </aside>


    </div>
  </div>
</div>





  



  



  



  



  







    

    
      <a id="scroll-top-button" aria-label="TOP" href="#" role="button">
        <i class="iconfont icon-arrowup" aria-hidden="true"></i>
      </a>
    

    
      <div class="modal fade" id="modalSearch" tabindex="-1" role="dialog" aria-labelledby="ModalLabel"
     aria-hidden="true">
  <div class="modal-dialog modal-dialog-scrollable modal-lg" role="document">
    <div class="modal-content">
      <div class="modal-header text-center">
        <h4 class="modal-title w-100 font-weight-bold">搜索</h4>
        <button type="button" id="local-search-close" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
      </div>
      <div class="modal-body mx-3">
        <div class="md-form mb-5">
          <input type="text" id="local-search-input" class="form-control validate">
          <label data-error="x" data-success="v" for="local-search-input">关键词</label>
        </div>
        <div class="list-group" id="local-search-result"></div>
      </div>
    </div>
  </div>
</div>

    

    
  </main>

  <footer>
    <div class="footer-inner">
  
    <div class="footer-content">
       <meta name="referrer" content="no-referrer" /> <footer id="footer" role="contentinfo"> <div class="divider"> <div class="wall"></div> <img class="animals" src="/img/footer_animals_new.png" srcset="/img/loading.gif" lazyload alt="Footer Animals"> </div> <div class="container" data-index="450"> <p> <a href="https://chiamzhang.github.io" target="_blank">DogEgg</a> <i class="iconfont icon-love"></i> <a href="#" target="_blank">LittePig</a> </p> <p> Powered by  <a href="https://hexo.io" target="_blank" rel="nofollow noopener"><span>Hexo</span></a> <i class="iconfont icon-pen"></i> Theme  <a href="https://github.com/fluid-dev/hexo-theme-fluid" target="_blank" rel="nofollow noopener"><span>Fluid</span></a> </p> </div> </footer> 
    </div>
  
  
  
  
</div>

  </footer>

  <!-- Scripts -->
  
  <script  src="https://lib.baomitu.com/nprogress/0.2.0/nprogress.min.js" ></script>
  <link  rel="stylesheet" href="https://lib.baomitu.com/nprogress/0.2.0/nprogress.min.css" />

  <script>
    NProgress.configure({"showSpinner":false,"trickleSpeed":100})
    NProgress.start()
    window.addEventListener('load', function() {
      NProgress.done();
    })
  </script>


<script  src="https://lib.baomitu.com/jquery/3.6.4/jquery.min.js" ></script>
<script  src="https://lib.baomitu.com/twitter-bootstrap/4.6.1/js/bootstrap.min.js" ></script>
<script  src="/js/events.js" ></script>
<script  src="/js/plugins.js" ></script>


  <script  src="https://lib.baomitu.com/typed.js/2.0.12/typed.min.js" ></script>
  <script>
    (function (window, document) {
      var typing = Fluid.plugins.typing;
      var subtitle = document.getElementById('subtitle');
      if (!subtitle || !typing) {
        return;
      }
      var text = subtitle.getAttribute('data-typed-text');
      
        typing(text);
      
    })(window, document);
  </script>




  
    <script  src="/js/img-lazyload.js" ></script>
  




  
<script>
  Fluid.utils.createScript('https://lib.baomitu.com/tocbot/4.20.1/tocbot.min.js', function() {
    var toc = jQuery('#toc');
    if (toc.length === 0 || !window.tocbot) { return; }
    var boardCtn = jQuery('#board-ctn');
    var boardTop = boardCtn.offset().top;

    window.tocbot.init(Object.assign({
      tocSelector     : '#toc-body',
      contentSelector : '.markdown-body',
      linkClass       : 'tocbot-link',
      activeLinkClass : 'tocbot-active-link',
      listClass       : 'tocbot-list',
      isCollapsedClass: 'tocbot-is-collapsed',
      collapsibleClass: 'tocbot-is-collapsible',
      scrollSmooth    : true,
      includeTitleTags: true,
      headingsOffset  : -boardTop,
    }, CONFIG.toc));
    if (toc.find('.toc-list-item').length > 0) {
      toc.css('visibility', 'visible');
    }

    Fluid.events.registerRefreshCallback(function() {
      if ('tocbot' in window) {
        tocbot.refresh();
        var toc = jQuery('#toc');
        if (toc.length === 0 || !tocbot) {
          return;
        }
        if (toc.find('.toc-list-item').length > 0) {
          toc.css('visibility', 'visible');
        }
      }
    });
  });
</script>


  <script src=https://lib.baomitu.com/clipboard.js/2.0.11/clipboard.min.js></script>

  <script>Fluid.plugins.codeWidget();</script>


  
<script>
  Fluid.utils.createScript('https://lib.baomitu.com/anchor-js/4.3.1/anchor.min.js', function() {
    window.anchors.options = {
      placement: CONFIG.anchorjs.placement,
      visible  : CONFIG.anchorjs.visible
    };
    if (CONFIG.anchorjs.icon) {
      window.anchors.options.icon = CONFIG.anchorjs.icon;
    }
    var el = (CONFIG.anchorjs.element || 'h1,h2,h3,h4,h5,h6').split(',');
    var res = [];
    for (var item of el) {
      res.push('.markdown-body > ' + item.trim());
    }
    if (CONFIG.anchorjs.placement === 'left') {
      window.anchors.options.class = 'anchorjs-link-left';
    }
    window.anchors.add(res.join(', '));

    Fluid.events.registerRefreshCallback(function() {
      if ('anchors' in window) {
        anchors.removeAll();
        var el = (CONFIG.anchorjs.element || 'h1,h2,h3,h4,h5,h6').split(',');
        var res = [];
        for (var item of el) {
          res.push('.markdown-body > ' + item.trim());
        }
        if (CONFIG.anchorjs.placement === 'left') {
          anchors.options.class = 'anchorjs-link-left';
        }
        anchors.add(res.join(', '));
      }
    });
  });
</script>


  
<script>
  Fluid.utils.createScript('https://lib.baomitu.com/fancybox/3.5.7/jquery.fancybox.min.js', function() {
    Fluid.plugins.fancyBox();
  });
</script>


  <script>Fluid.plugins.imageCaption();</script>

  <script  src="/js/local-search.js" ></script>




  
<script src="/js/love.js"></script>
<script src="/js/funnyTitle.js"></script>
<script src="/js/backTop.js"></script>
<script src="//cdn.jsdelivr.net/gh/bynotes/texiao/source/js/xiaoxuehua.js"></script>



<!-- 主题的启动项，将它保持在最底部 -->
<!-- the boot of the theme, keep it at the bottom -->
<script  src="/js/boot.js" ></script>


  

  <noscript>
    <div class="noscript-warning">博客在允许 JavaScript 运行的环境下浏览效果更佳</div>
  </noscript>
<script src="/live2dw/lib/L2Dwidget.min.js?094cbace49a39548bed64abff5988b05"></script><script>L2Dwidget.init({"pluginRootPath":"live2dw/","pluginJsPath":"lib/","pluginModelPath":"assets/","tagMode":false,"debug":false,"model":{"jsonPath":"/live2dw/assets/wanko.model.json"},"display":{"position":"left","width":150,"height":150,"hOffset":20,"vOffset":0},"mobile":{"show":false,"scale":0.5},"react":{"opacity":0.9},"log":false});</script></body>
</html>
